using Lzfy_His_Service.Models;

namespace Lzfy_His_Service.Repositories
{
    public interface IRefundTaskMasterRepository
    {
        Task<RefundTaskMaster?> GetByIdAsync(long id);
        Task<IEnumerable<RefundTaskMaster>> GetAllAsync();
        Task<(IEnumerable<RefundTaskMaster> data, int totalCount)> GetAllPagedAsync(int pageIndex = 1, int pageSize = 100);
        Task<(IEnumerable<RefundTaskMaster> data, int totalCount)> GetWithFilterAsync(
            DateTime? startDate = null,
            DateTime? endDate = null,
            string? username = null,
            string? fullname = null,
            int pageIndex = 1,
            int pageSize = 20);
        Task<IEnumerable<RefundTaskMaster>> GetByUsernameAsync(string username);
        Task<long> CreateAsync(RefundTaskMaster refundTaskMaster);
        Task<long> CreateAsync(RefundTaskMaster refundTaskMaster, System.Data.IDbConnection connection, System.Data.IDbTransaction? transaction = null);
        Task<bool> UpdateAsync(RefundTaskMaster refundTaskMaster);
        Task<bool> UpdateAsync(RefundTaskMaster refundTaskMaster, System.Data.IDbConnection connection, System.Data.IDbTransaction? transaction = null);
        Task<bool> DeleteAsync(long id);
        Task<RefundTaskMaster?> GetWithDetailsAsync(long id);
        Task<bool> UpdateBalanceFromDetailsAsync(long id);
        Task<bool> UpdateBalanceFromDetailsAsync(long id, System.Data.IDbConnection connection, System.Data.IDbTransaction? transaction = null);
        System.Data.IDbConnection GetConnection();
    }
}